﻿using System.ComponentModel;
using System.Linq;

namespace OpenQuant.Quik.Design
{
    public class AccountConvertor : StringConverter
    {
        public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
        {
            return true;
        }

        public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
        {
            return true;
        }

        public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
        {
            return new StandardValuesCollection(Provider.QuikTrader.Portfolios.OrderBy(p => p.Name).ToArray());
        }
    }
}
